package cn.com.huzo.model.entities.oa;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 待办事项实体类
 *
 * @author 吴旭
 */
public class ToDoEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 4539307524982301335L;
    private String TaskId;               // 任务ID
    private String TaskName;             // 任务名称
    private String ProcessInstanceId;    // 流程实例ID
    private String BusinessKey;          // 对应的业务ID
    private Integer Priority;            // 优先级(默认值为50)
    private String ProcDefName;          // 流程名称（任务对应的流程）
    private Timestamp CreateTime;        // 任务创建时间
    private String StartUserName;        // 任务发起人
    private Integer Assignee;            // 签收人ID
    private String AssigneeName;         // 签收人名

    public String getTaskId() {
        return TaskId;
    }

    public void setTaskId(String TaskId) {
        this.TaskId = TaskId;
    }

    public String getTaskName() {
        return TaskName;
    }

    public void setTaskName(String TaskName) {
        this.TaskName = TaskName;
    }

    public String getProcessInstanceId() {
        return ProcessInstanceId;
    }

    public void setProcessInstanceId(String ProcessInstanceId) {
        this.ProcessInstanceId = ProcessInstanceId;
    }

    public String getBusinessKey() {
        return BusinessKey;
    }

    public void setBusinessKey(String BusinessKey) {
        this.BusinessKey = BusinessKey;
    }

    public Integer getPriority() {
        return Priority;
    }

    public void setPriority(Integer Priority) {
        this.Priority = Priority;
    }

    public String getProcDefName() {
        return ProcDefName;
    }

    public void setProcDefName(String ProcDefName) {
        this.ProcDefName = ProcDefName;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getCreateTime() {
        return CreateTime;
    }

    public void setCreateTime(Timestamp CreateTime) {
        this.CreateTime = CreateTime;
    }

    public String getStartUserName() {
        return StartUserName;
    }

    public void setStartUserName(String StartUserName) {
        this.StartUserName = StartUserName;
    }

    public Integer getAssignee() {
        return Assignee;
    }

    public void setAssignee(Integer Assignee) {
        this.Assignee = Assignee;
    }

    public String getAssigneeName() {
        return AssigneeName;
    }

    public void setAssigneeName(String AssigneeName) {
        this.AssigneeName = AssigneeName;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ToDoEntity)) {
            return false;
        }

        final ToDoEntity that = (ToDoEntity) o;

        return new EqualsBuilder()
                .append(this.getTaskId(), that.getTaskId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getTaskId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
